package oo_day01;
/** 继承的测试类 */
public class ExtendsTest {
    public static void main(String[] args) {
        Student zg =new Student();
        zg.name="张光";
        zg.age=23;
        zg.address="廊坊";
        zg.className="jsd2504";
        zg.stuId="001";
        zg.eat();
        zg.sleep();
        zg.sayHi();
        zg.study();

        Student ll =new Student("李林",23,"内蒙古","jsd2504","001");
        ll.eat();
        ll.sleep();
        ll.sayHi();
        ll.study();

        Doctor hff = new Doctor("何芳芳",39,"山西","主任医师");
        hff.eat();
        hff.sleep();
        hff.sayHi();
        hff.cut();

        Teacher wl = new Teacher("王蕾",37,"山西",4000.0);
        wl.eat();
        wl.sleep();
        wl.sayHi();
        wl.teach();

    //演示超累不能访问派生类的
    Person p = new Person();
    p.name="人";
    p.age = 1;
    p.address = "未知";
        p.eat();
        p.sleep();
        p.sayHi();
    //p.stuId = "005"; //编译错误，超类不能访问派生类的
    }
}
